package cn.com.yiqi.wsc.dao.customer;

import cn.com.yiqi.wsc.Ro.CartVO;
import cn.com.yiqi.wsc.entity.customer.Cart;
import cn.com.yiqi.wsc.entity.customer.CartExample;

import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface CartMapper {

    int deleteByPrimaryKey(Integer id);


    int insertSelective(Cart record);

    Cart selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Cart record);

    List<CartVO> findItemInfo(Integer userId);

    void insertLog(@Param("userId") Integer userId, @Param("type") int i, @Param("itemId") Integer itemId);

    void deleteUserCart(Integer userId);

    BigDecimal calTotalByuserId(Integer userId);

    List<CartVO>  selectCartByCustomerId(Integer customerId );

    Cart findByItemIdAndUserId(@Param("userId") Integer userId, @Param("itemId") Integer itemId);

    List<Cart> findbyUserId(Integer userId);
}